home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / commands / fixbin.sh < prev    next >
Text File  |  1990-07-23  |  3KB  |  140 lines

  1. #This shell script installs new binaries, changing sizes and modes
  2. #Call: fixbin src_dir dst_dir
  3. #Example: fixbin /usr/src/commands/bin /bin
  4.  
  5. #Check for args
  6. case $# in
  7. 2) ;;
  8. *) echo Usage: $0 src_dir dst_dir
  9.    exit 1
  10.    ;;
  11. esac
  12.  
  13. src=$1
  14. dst=$2
  15. if test -d $src; then : ; else echo $src is not a directory; exit 1; fi
  16. if test -d $dst; then : ; else echo $dst is not a directory; exit 1; fi
  17.  
  18. #Is dst dir writable?
  19. date >$dst/$$
  20. if test -r $dst/$$
  21.    then :
  22.    else echo $0: $dst is not writable
  23.         exit 1
  24. fi
  25.  
  26. #Is this script running as superuser?
  27. if chown bin $dst/$$ >/dev/null 2>&1
  28.    then rm $dst/$$
  29.    else echo You must be superuser to run $0
  30.     rm $dst/$$
  31.     exit 1
  32. fi
  33.     
  34. #Copy all the files into position if needed
  35. if test $src = $dst
  36.    then :            # e.g., $0 /bin /bin
  37.    else cd $src
  38.     cp * $dst
  39. fi
  40.     
  41. #Set owner
  42. cd $dst
  43. chown bin *
  44.  
  45. #The following files are setuid root
  46. chown root $dst/at
  47. chown root $dst/df
  48. chown root $dst/login
  49. chown root $dst/mv
  50. chown root $dst/passwd
  51. chown root $dst/recover
  52. chown root $dst/su
  53.  
  54. chmod 4755 $dst/at
  55. chmod 4755 $dst/df
  56. chmod 4755 $dst/login
  57. chmod 4755 $dst/mv
  58. chmod 4755 $dst/passwd
  59. chmod 4755 $dst/recover
  60. chmod 4755 $dst/su
  61.  
  62. #Increase default stack size from 8K to more for selected programs
  63. chmem =50000 $dst/ar
  64. chmem =10000 $dst/cgrep
  65. chmem =16000 $dst/cp
  66. chmem =55000 $dst/cdiff
  67. chmem =64000 $dst/compress
  68. chmem =64000 $dst/cpdir
  69. chmem =64000 $dst/cron
  70. chmem =30000 $dst/de
  71. chmem =40000 $dst/dd
  72. chmem =32000 $dst/du
  73. chmem =55000 $dst/diff
  74. chmem =60000 $dst/ed
  75. chmem =50000 $dst/file
  76. chmem =50000 $dst/find
  77. chmem =60000 $dst/fix
  78. chmem =60000 $dst/fsck
  79. chmem =60000 $dst/indent
  80. chmem =10000 $dst/last
  81. chmem =20000 $dst/make
  82. chmem =10000 $dst/man
  83. chmem =64000 $dst/mined
  84. chmem =40000 $dst/mkfs
  85. chmem =40000 $dst/mkproto
  86. chmem =15000 $dst/mref
  87. chmem =16000 $dst/nm
  88. chmem =65000 $dst/nroff
  89. chmem =20000 $dst/patch
  90. chmem =32000 $dst/pr
  91. chmem =60000 $dst/ps
  92. chmem =50000 $dst/readfs
  93. chmem =16000 $dst/roff
  94. chmem =60000 $dst/sed
  95. chmem =20000 $dst/sh
  96. chmem =60000 $dst/sort
  97. chmem =16000 $dst/strip
  98. chmem =16000 $dst/strings
  99. chmem =60000 $dst/tar
  100. chmem =60000 $dst/treecmp
  101.  
  102. # remove old linked files and make new ones
  103. rm -rf chip uncompress zcat ex vi
  104. ln machine chip
  105. ln compress uncompress
  106. ln compress zcat
  107. ln elvis ex
  108. ln elvis vi
  109.  
  110. if chip INTEL
  111. then
  112.    chown root $dst/readclock
  113.    chmod 4755 $dst/readclock
  114.  
  115.    chmem =16000 $dst/ast
  116.    chmem =60000 $dst/asld
  117.    chmem =32000 $dst/dosread
  118.    chmem =64000 $dst/libpack
  119.    chmem =64000 $dst/libupack
  120.    chmem =60000 $dst/lorder
  121.    chmem =60000 $dst/tsort
  122.  
  123.    rm -rf doswrite dosdir
  124.    ln dosread doswrite
  125.    ln dosread dosdir
  126. fi
  127.  
  128. if chip M68000
  129. then
  130.    chmem =20000 $dst/anm
  131.    chmem =20000 $dst/cc
  132. #  chmem =20000 $dst/cv usr/lib !!!
  133.    chmem =25000 $dst/tos
  134.  
  135.    rm -rf tosdir tosread toswrite 
  136.    ln tos tosdir
  137.    ln tos tosread
  138.    ln tos toswrite
  139. fi
  140.